<?php

/**
 *
 * @copyright	Copyright 2009-2012   庆丰裕软件工作室
 * @author	Zheng HanWei <315933614@qq.com
 * @link	http://www.qfyu.net/
 *  
 * */
if ($_GET['did']) {
    $sql = "delete from " . TRAINTXT . " where id=".$_GET['did'];
    $db->query($sql);
     echo "<script>location.href='module.php?m=train&s=train_text_list.php';</script>"; 
}

$sql="select a.*,b.name from ".TRAINTXT." as a inner join ".TRAINCATS." as b on(a.cat=b.id) where 1 order by id desc";
$db->query($sql);
$re=$db->getRows();


?>
<HTML>
<HEAD>
<TITLE><?php echo lang_show('admin_system');?></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<link href="main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="main.js"></script>
</HEAD>
<body>
<div class="guidebox"><?php echo lang_show('system_setting_home');?> &raquo; <?php echo lang_show('hr_info_manager');?></div>

<form action="" method="post">
    <div class="bigbox">
        <div class="bigboxhead">视频管理</div>
        <div class="bigboxbody">
            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                <tr align="center"> 
                    <td width="10%">ID</td>
                    <td width="20%">电子书封面</td>
                    <td width="25%">视频标题</td>
                    <td width="10%">视频类别</td>
                    <td width="15%">添加时间</td>
                    <td>管理</td>
                </tr>
                <?php foreach($re as $val){?>
                <tr>
                    <td align="center"><?php echo $val['id']?></td>
                    <td><img width="100" src="<?php echo $config['weburl'].'/uploadfile/text/img/'.$val['cover']?>"></td>
                    <td><?php echo $val['title']?></td>
                    <td align="center"><?php echo $val['name']?></td>

                    <td align="center"><?php echo date('Y-m-d H:i:s',$val['addtime']);?></td>
                    <td align="center">
                            <a href="module.php?m=train&s=train_text.php&id=<?php echo $val['id']?>">
                                <img src="<?php echo $config['weburl']?>/image/admin/edit.gif">
                            </a>　
                            <a href="module.php?m=train&s=train_text_list.php&did=<?php echo $val['id']?>" onclick="return confirm('确认要删除？');">
                                <img src="<?php echo $config['weburl']?>/image/admin/del.gif">
                            </a>
                        </td>
                </tr>
                <?php }?> 
                <tr>

                    <td colspan="6" align="right"><div class="page"><?php echo $pages ?></div></td>
                </tr>
            </table>
        </div>
    </div>
</form>
</body>
</html>